﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Knihkupectvo.ImportFaktur;
using Knihkupectvo.SpocitejCenu;


namespace Knihkupectvo
{
    public partial class Form1 : Form
    {
        ImportujFakturuControl IFC = new ImportujFakturuControl();
        public Form1()
        {
            InitializeComponent();
            ObjednavkaTest o = new ObjednavkaTest(200, false, true, true, true, true);

            SpocitejCenu(o);
        }
        private void SpocitejCenu(ISpocitejCenu obj)
        {

            Objednavka objednavka = new Objednavka(obj.cena, obj.jeSleva);

            Postovne post = new Postovne(new DarkoveBaleni( new PlatbaCC( objednavka)), obj.express, obj.eu);
            
            Console.WriteLine(post.getCena());
        }


        private void button1_Click(object sender, EventArgs e)
        {
            DialogResult result = openFileDialog1.ShowDialog();
            if (result == DialogResult.OK) // Test result.
            {
                IFC.UlozFakturu(openFileDialog1.FileName);
            }
        }
    }
}
